<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class Guest extends CI_Model
{
    public function __construct()
    {
        parent::__construct();
    }

    public function add($data=false)
    {
        if(!$data)
            return false;
        $this->db->insert('guest', $data);
        if($this->db->affected_rows())
        {
            return $this->db->insert_id();
        }
        return false;
    }

    public function get($id=false)
    {
        if(!$id)
            return false;
        $query = $this->db->get_where('guest', array('id'=>$id));
        if($query->num_rows())
        {
            return $query->row();
        }
        return false;
    }
}
